package net.maku.system.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fhs.core.trans.anno.Trans;
import com.fhs.core.trans.constant.TransType;
import com.fhs.core.trans.vo.TransPojo;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;
import net.maku.framework.common.utils.DateUtils;
import net.maku.framework.common.utils.TreeNode;
import net.maku.system.entity.SysUserEntity;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 机构列表
 *
 * @author 阿沐 babamu@126.com
 * <a href="https://maku.net">MAKU</a>
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "机构")
public class SysOrgVO extends TreeNode<SysOrgVO> implements Serializable , TransPojo {

    @Schema(description = "主键")
    private Long id;

    @Schema(description = "上级名称")
    private String parentName;

    @Schema(description = "单位图片")
    private String picture;

    @Schema(description = "机构名称", required = true)
    @NotBlank(message = "机构名称不能为空")
    private String name;

    @Schema(description = "简称")
    private String shortenedName;

    @Schema(description = "统一信用代码")
    private String creditCode;

    @Schema(description = "工会类型")
    private Integer unionType;
     
    @Schema(description = "工会负责人")
    private String unionHead;

    @Schema(description = "负责人手机号")
    private String unionHeadPhone;

    @Schema(description = "成立时间")
    private String establishmentTime;

    @Schema(description = "本届任期-开始")
    private String currentTermStart;

    @Schema(description = "本届任期-结束")
    private String currentTermEnd;

    @Schema(description = "工会所在地")
    private String address;

    @Schema(description = "工会银行账号")
    private String bankAccountNumber;

    @Schema(description = "开户行")
    private String bankDeposit;

    @Schema(description = "工会简称")
    private String unionAbbreviation;

    @Schema(description = "工会状态")
    private Integer status;

    @Schema(description = "附件")
    private String attachments;

    @Schema(description = "工会人数")
    private Integer peopleNum;

    @Schema(description = "管理员id")
    @Trans(type = TransType.SIMPLE, target = SysUserEntity.class, fields = "username", ref = "adminName")
    private Long adminId;

    @Schema(description = "管理员id")
    private String adminName;

    @Schema(description = "入会码")
    private String applicationCode;

    @Schema(description = "负责人ID")
    private Long leaderId;

    @Schema(description = "排序", required = true)
    @Min(value = 0, message = "排序值不能小于0")
    private Integer sort;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = DateUtils.DATE_TIME_PATTERN)
    private LocalDateTime createTime;


    private List<SysOrgMemberVO> sysOrgMemberVOList;
}